package com.qingcheng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.order.OrderService;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/userOrder")
public class UserOrderController {
    @Reference
    private OrderService orderService;



    /**
     * 查询所有用户订单
     * @return
     */

    @GetMapping("/queryAllOrder")
    public Map<String,Object> queryAllOrder(){
        //String username = SecurityContextHolder.getContext().getAuthentication().getName();
        String username="lijialong";
        Map<String, Object> allOrderMap = orderService.queryOrderListByUsername(username);
        return allOrderMap;
    }
}
